package com.guomei.utils;

import lombok.Data;

import java.math.BigDecimal;
import java.util.List;
@Data
public class PageData<T> {
    private List<T> data;
    private int pageNum;
    private int pageSize;
    private long total;
    //课程详情专用
    private List<Integer> buyed;
    //分销金额（看登入人）
    private BigDecimal CountdistributionAmount;
    //订单数量（看登入人）
    private int CountOrderCount;
    //邀请人数（看登入人）
    private int CountInviteCount;

    public PageData(List<T> data) {
        this.data = data;
    }

    public List<T> getData() {
        return this.data;
    }

    public int getPageNum() {
        return this.pageNum;
    }

    public int getPageSize() {
        return this.pageSize;
    }

    public long getTotal() {
        return this.total;
    }

    public void setData(List<T> data) {
        this.data = data;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof PageData)) {
            return false;
        } else {
            PageData<?> other = (PageData)o;
            if (!other.canEqual(this)) {
                return false;
            } else if (this.getPageNum() != other.getPageNum()) {
                return false;
            } else if (this.getPageSize() != other.getPageSize()) {
                return false;
            } else if (this.getTotal() != other.getTotal()) {
                return false;
            } else {
                Object this$data = this.getData();
                Object other$data = other.getData();
                if (this$data == null) {
                    if (other$data != null) {
                        return false;
                    }
                } else if (!this$data.equals(other$data)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof PageData;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        result = result * 59 + this.getPageNum();
        result = result * 59 + this.getPageSize();
        long $total = this.getTotal();
        result = result * 59 + (int)($total >>> 32 ^ $total);
        Object $data = this.getData();
        result = result * 59 + ($data == null ? 43 : $data.hashCode());
        return result;
    }

    public String toString() {
        return "PageData(data=" + this.getData() + ", pageNum=" + this.getPageNum() + ", pageSize=" + this.getPageSize() + ", total=" + this.getTotal() + ")";
    }

    public PageData(List<T> data, int pageNum, int pageSize, long total) {
        this.data = data;
        this.pageNum = pageNum;
        this.pageSize = pageSize;
        this.total = total;
    }

    public PageData() {
    }
}
